<?php
    $cerez = @$_COOKIE["kullanici"];
    if ($cerez == "") {
?>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <script type="text/javascript">
        alert("Bu alanı görmeye yetkiniz yok");
        window.location="../giris.php";
    </script>
    <?php
    } else {
    include "includes/ayar.php";
    $referans = $_POST["referans"];

    mysql_query("UPDATE referans SET referans='$referans'");

    if (@mysql_query) {
        ?>
        <script type="text/javascript">
            alert("Referans sayfası güncellendi.");
            window.location="referans.php";
        </script>
        <?php
    } else {
        ?>
        <script type="text/javascript">
            alert("Referans sayfası güncellenemedi.");
            window.location="referans.php";
        </script>
        <?php
    }
}
?>